home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / clean / sun3.lha / Sun3 / seqdemos / stwice.icl < prev    next >
Text File  |  1992-08-07  |  367b  |  20 lines

  1. MODULE stwice;
  2.  
  3. <<
  4. The strict Twice function.
  5.  
  6. An integer (0) is incremented 65536 times using the higher
  7. order function Twice. The Twice function has a local
  8. strictness annotation which makes it more efficient.
  9. >>
  10.  
  11. IMPORT deltaI;
  12.  
  13. RULE
  14.  
  15. ::  Twice (=> x x) x    -> x;
  16.     Twice f x           -> f !(f x);
  17.  
  18. ::  Start -> INT;
  19.     Start -> Twice Twice Twice Twice ++ 0;
  20.